package 多线程和队列.lambda;

import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

/**
 * @author 孔令富  2021/12/20
 */
public class LambdaDemo {
    public static void main(String[] args) {

        Function<String,Integer> function  = String::length;
        System.out.println(function.apply("222"));

        Predicate<String> predicate = t -> t.startsWith("a");
        System.out.println(predicate.test("abc"));

        Consumer<String> consumer = t ->{
            System.out.println(t);
        };

        consumer.accept("konglingfu");

        Supplier<String> supplier = ()-> UUID.randomUUID().toString();

        System.out.println(supplier.get());
    }
}
